#include <iostream>
#include <vector>
int main(){
    int n; std::cin >> n;
    if(n < 0) return -1;
    std::vector<int> ret(1,0);
    for(int i = 1; i <= n; ++i){
        int carriage = 0;
        int j = 0;
        int x = i;
        while(x > 0 || carriage > 0){
            if(j >= ret.size()) ret.push_back(0);
            int sum = ret[j] + (x % 10) + carriage;
            ret[j] = sum % 10;
            carriage = sum / 10;
            x /= 10;
            j++;
        }
    }
    for(auto it = ret.rbegin(); it != ret.rend(); ++it){
        std::cout << *it;
    }
    return 0;
}